package cn.xiaobai.enums;

import com.melloware.jintellitype.JIntellitypeConstants;

/**
 * 功能热键
 *
 * @Author yangdaji
 * @Date 2022/10/13 0013
 * @PackageName cn.xiaobai.enums
 * @ClassName HotKeyEnum
 */
public enum ModHotKeyEnum {

    MOD_CONTROL("CTRL", JIntellitypeConstants.MOD_CONTROL),

    MOD_SHIFT("SHIFT", JIntellitypeConstants.MOD_SHIFT),

    MOD_ALT("ALT", JIntellitypeConstants.MOD_ALT),

    MOD_WIN("WIN", JIntellitypeConstants.MOD_WIN),
    ;

    private String key;
    private Integer keycode;

    ModHotKeyEnum(String key, Integer keycode) {
        this.key = key;
        this.keycode = keycode;
    }

    public static Integer getKeyCode(String key) {
        for (ModHotKeyEnum item : values()) {
            if (item.getKey().equalsIgnoreCase(key)) {
                return item.getKeycode();
            }
        }
        return null;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public Integer getKeycode() {
        return keycode;
    }

    public void setKeycode(Integer keycode) {
        this.keycode = keycode;
    }
}
